3.215 \(\int \frac{\cot ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=89 \[ -\frac{b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^2 f (a-b)}-\frac{(a+b) \log (\tan (e+f x))}{a^2 f}-\frac{\log (\cos (e+f x))}{f (a-b)}-\frac{\cot ^2(e+f x)}{2 a f} \]

[Out]

-Cot[e + f*x]^2/(2*a*f) - Log[Cos[e + f*x]]/((a - b)*f) - ((a + b)*Log[Tan[e + f*x]])/(a^2*f) - (b^2*Log[a + b
*Tan[e + f*x]^2])/(2*a^2*(a - b)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.112835, antiderivative size = 89, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 72} \[ -\frac{b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^2 f (a-b)}-\frac{(a+b) \log (\tan (e+f x))}{a^2 f}-\frac{\log (\cos (e+f x))}{f (a-b)}-\frac{\cot ^2(e+f x)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

-Cot[e + f*x]^2/(2*a*f) - Log[Cos[e + f*x]]/((a - b)*f) - ((a + b)*Log[Tan[e + f*x]])/(a^2*f) - (b^2*Log[a + b
*Tan[e + f*x]^2])/(2*a^2*(a - b)*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int \frac{\cot ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^3 \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{x^2 (1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{a x^2}+\frac{-a-b}{a^2 x}+\frac{1}{(a-b) (1+x)}-\frac{b^3}{a^2 (a-b) (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac{\cot ^2(e+f x)}{2 a f}-\frac{\log (\cos (e+f x))}{(a-b) f}-\frac{(a+b) \log (\tan (e+f x))}{a^2 f}-\frac{b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^2 (a-b) f}\\ \end{align*}

Mathematica [A]  time = 0.249807, size = 63, normalized size = 0.71 \[ -\frac{\frac{b^2 \log \left (a \cot ^2(e+f x)+b\right )}{a^2 (a-b)}+\frac{2 \log (\sin (e+f x))}{a-b}+\frac{\cot ^2(e+f x)}{a}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

-(Cot[e + f*x]^2/a + (b^2*Log[b + a*Cot[e + f*x]^2])/(a^2*(a - b)) + (2*Log[Sin[e + f*x]])/(a - b))/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.08, size = 150, normalized size = 1.7 \begin{align*} -{\frac{1}{4\,fa \left ( \cos \left ( fx+e \right ) +1 \right ) }}-{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{2\,fa}}-{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) b}{2\,f{a}^{2}}}-{\frac{{b}^{2}\ln \left ( a \left ( \cos \left ( fx+e \right ) \right ) ^{2}- \left ( \cos \left ( fx+e \right ) \right ) ^{2}b+b \right ) }{2\,f{a}^{2} \left ( a-b \right ) }}+{\frac{1}{4\,fa \left ( \cos \left ( fx+e \right ) -1 \right ) }}-{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{2\,fa}}-{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) b}{2\,f{a}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x)

[Out]

-1/4/f/a/(cos(f*x+e)+1)-1/2/f/a*ln(cos(f*x+e)+1)-1/2/f/a^2*ln(cos(f*x+e)+1)*b-1/2/f*b^2/a^2/(a-b)*ln(a*cos(f*x
+e)^2-cos(f*x+e)^2*b+b)+1/4/f/a/(cos(f*x+e)-1)-1/2/f/a*ln(cos(f*x+e)-1)-1/2/f/a^2*ln(cos(f*x+e)-1)*b

________________________________________________________________________________________

Maxima [A]  time = 1.11219, size = 92, normalized size = 1.03 \begin{align*} -\frac{\frac{b^{2} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{3} - a^{2} b} + \frac{{\left (a + b\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{2}} + \frac{1}{a \sin \left (f x + e\right )^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*(b^2*log(-(a - b)*sin(f*x + e)^2 + a)/(a^3 - a^2*b) + (a + b)*log(sin(f*x + e)^2)/a^2 + 1/(a*sin(f*x + e)
^2))/f

________________________________________________________________________________________

Fricas [A]  time = 1.22708, size = 297, normalized size = 3.34 \begin{align*} -\frac{b^{2} \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} +{\left (a^{2} - b^{2}\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) \tan \left (f x + e\right )^{2} +{\left (a^{2} - a b\right )} \tan \left (f x + e\right )^{2} + a^{2} - a b}{2 \,{\left (a^{3} - a^{2} b\right )} f \tan \left (f x + e\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*(b^2*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1))*tan(f*x + e)^2 + (a^2 - b^2)*log(tan(f*x + e)^2/(ta
n(f*x + e)^2 + 1))*tan(f*x + e)^2 + (a^2 - a*b)*tan(f*x + e)^2 + a^2 - a*b)/((a^3 - a^2*b)*f*tan(f*x + e)^2)

________________________________________________________________________________________

Sympy [A]  time = 68.3657, size = 743, normalized size = 8.35 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**3/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(e, 0) & Eq(f, 0)), ((-log(tan(e + f*x)**2 + 1)/(2*f) + log(tan(e +
f*x))/f + 1/(2*f*tan(e + f*x)**2) - 1/(4*f*tan(e + f*x)**4))/b, Eq(a, 0)), (2*log(tan(e + f*x)**2 + 1)*tan(e +
 f*x)**4/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) + 2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*a*f*t
an(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) - 4*log(tan(e + f*x))*tan(e + f*x)**4/(2*a*f*tan(e + f*x)**4 + 2*a*f*t
an(e + f*x)**2) - 4*log(tan(e + f*x))*tan(e + f*x)**2/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) - 2*tan(
e + f*x)**2/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2) - 1/(2*a*f*tan(e + f*x)**4 + 2*a*f*tan(e + f*x)**2
), Eq(a, b)), (zoo*x/a, Eq(e, -f*x)), (x*cot(e)**3/(a + b*tan(e)**2), Eq(f, 0)), ((log(tan(e + f*x)**2 + 1)/(2
*f) - log(tan(e + f*x))/f - 1/(2*f*tan(e + f*x)**2))/a, Eq(b, 0)), (a**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)
**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - 2*a**2*log(tan(e + f*x))*tan(e + f*x)**2/(2*a**3
*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - a**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2
) + a*b/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - b**2*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x)
)*tan(e + f*x)**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) - b**2*log(I*sqrt(a)*sqrt(1/b) + tan
(e + f*x))*tan(e + f*x)**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2) + 2*b**2*log(tan(e + f*x))*
tan(e + f*x)**2/(2*a**3*f*tan(e + f*x)**2 - 2*a**2*b*f*tan(e + f*x)**2), True))

________________________________________________________________________________________

Giac [B]  time = 1.4894, size = 551, normalized size = 6.19 \begin{align*} \frac{\frac{8 \,{\left (2 \, a^{5} - 2 \, a^{4} b + a^{3} b^{2} - a^{2} b^{3}\right )} \log \left (24 \,{\left | a \right |}^{3}\right )}{a^{6} - 2 \, a^{5} b + a^{4} b^{2}} - \frac{4 \,{\left (2 \, a^{5} - 2 \, a^{4} b + a^{3} b^{2} - a^{2} b^{3}\right )} \log \left ({\left | -12 \, a^{4} \cos \left (f x + e\right )^{2} + 12 \, a^{3} b \cos \left (f x + e\right )^{2} - 12 \, a^{3} b \right |}\right )}{a^{6} - 2 \, a^{5} b + a^{4} b^{2}} - \frac{12 \,{\left (a + b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}} + \frac{8 \,{\left (a + b\right )} \log \left ({\left | a + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} \right |}\right )}{a^{2}} + \frac{3 \,{\left (a + \frac{4 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}}{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}} + \frac{3 \,{\left (\cos \left (f x + e\right ) - 1\right )}}{a{\left (\cos \left (f x + e\right ) + 1\right )}}}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/24*(8*(2*a^5 - 2*a^4*b + a^3*b^2 - a^2*b^3)*log(24*abs(a)^3)/(a^6 - 2*a^5*b + a^4*b^2) - 4*(2*a^5 - 2*a^4*b
+ a^3*b^2 - a^2*b^3)*log(abs(-12*a^4*cos(f*x + e)^2 + 12*a^3*b*cos(f*x + e)^2 - 12*a^3*b))/(a^6 - 2*a^5*b + a^
4*b^2) - 12*(a + b)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/a^2 + 8*(a + b)*log(abs(a + a*(cos(f*x + e) -
1)/(cos(f*x + e) + 1) - 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^
2 + 4*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - a*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3))/a^2 + 3*(a +
 4*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1))*(cos(f*x + e) + 1)/(a^
2*(cos(f*x + e) - 1)) + 3*(cos(f*x + e) - 1)/(a*(cos(f*x + e) + 1)))/f